#include "Core.h"

__BEGIN_NAMESPACE


UUID::UUID() {
	dword r;
	for(int i = 0; i < 4; i++) {
		r = Random();
		Memcpy(mBytes + i*4, (char*)&r, 4);
	}
	/* reversion 0b10 */
	mBytes[8] = (mBytes[8] & 0x3F) | 0x80;
}

UUID::UUID( const char* name )
{

}

UUID::UUID( const UUID& other )
{
	Memcpy(mBytes, (const char*)(other.mBytes), sizeof(UUID));
}

bool UUID::operator == (const UUID& other) const
{
	return 0==Memcmp(mBytes, (const char*)(other.mBytes), sizeof(UUID));
}

__END_NAMESPACE
